package com.resourcestore.dao;

import java.util.List;

import com.resourcestore.dao.BaseDao;
import com.resourcestore.model.Major;
import com.resourcestore.model.MajorGroup;
import com.resourcestore.utils.tag.Pagination;


public class MajorDao extends BaseDao {

	public List<Major> selectMajor(){
		List<Major> list=this.queryForList("selectMajor");
		return list;
	}
	
	public List<Major> selectMajorByMajorGroupId(Major major){
		List<Major> list=this.queryForList("selectMajorByMajorGroupId",major);
		return list;
	}
	public List<Major> selectMajorByDepartmentId(Major major){
		List<Major> list=this.queryForList("selectMajorByDepartmentId",major);
		return list;
	}
	
	public List<Major> selectMajorPage(Major major,Pagination pagination){
		List<Major> list = this.queryForPage("selectMajorPage", major,pagination);
		return list;
	}
	
	public int queryMajorNum(Major major) {
		return this.queryNum("selectMajorCount", major);
	}
	
	public Major selectMajorById(Major major){
		return (Major)this.queryForObject("selectMajorById", major);
	}
	
	public void insertMajor(Major major){
		this.insert("insertMajor", major);		
	}
	
	public void updateMajor(Major major){
		this.update("updateMajor", major);	
	}
	
	public void deleteMajor(Major major){
		this.delete("deleteMajor", major);
	}
	
	public void deleteMoreMajor(Major major){
		this.delete("deleteMoreMajor", major);
	}
}
